package com.ubst.smartad.common;

import java.io.*;

public class BinaryTree
implements Serializable
{
	BinaryTree parent, left, right, currNode;
	byte value, value2;

	public BinaryTree() {
		value = (byte)0x00;
		value2 = (byte)0x00;
		left = null;
		right = null;
		parent = null;
	}

	public BinaryTree(byte i) {
		this();
		value = i;
		value2 = (byte)0x00;
	}

	public byte getValue() {
		return value;
	}

	public void setValue(byte i) {
		value = i;
	}

	public byte getValue2() {
		return value2;
	}

	public void setValue2(byte i) {
		value2 = i;
	}

	public void addLeft(BinaryTree node) {
		left = node;
		node.setParent(this);
	}

	public void addRight(BinaryTree node) {
		right = node;
		node.setParent(this);
	}

	public BinaryTree getLeft() {
		return left;
	}

	public BinaryTree getRight() {
		return right;
	}

	public void setParent(BinaryTree node) {
		parent = node;
	}

	public BinaryTree getParent() {
		return parent;
	}

	public void setCurrNode(BinaryTree node) {
		currNode = node;
	}

	public BinaryTree getCurrNode() {
		return currNode;
	}
}
